package com.bsoft.gol.hcs.clinical.dao;

import ctd.persistence.annotation.DAOMethod;
import ctd.persistence.annotation.DAOParam;
import ctd.persistence.support.hibernate.HibernateSupportDelegateDAO;
import hcn.base.drug.BaseDrugContrast;

/**
 * Created by yangyi on 2019-12-19
 */
public abstract class DrugContrastDAO extends HibernateSupportDelegateDAO<BaseDrugContrast> {
    public DrugContrastDAO() {
        this.setKeyField("contrastId");
    }

    /**
     * 更新审核状态
     * @param objectDrugId
     */
    @DAOMethod(sql = "update BaseDrugContrast set checkUser=:checkUser,checkStatus=:checkStatus,modifyDt=now() where objectDrugId=:objectDrugId and objectId=:objectId")
    public abstract void updateCheckStatus(@DAOParam("objectDrugId") Integer objectDrugId,@DAOParam("checkUser") String checkUser,
                                           @DAOParam("checkStatus") String checkStatus,@DAOParam("objectId") String objectId);

    @DAOMethod(sql = " from BaseDrugContrast where objectDrugId=:objectDrugId and objectId=:objectId")
    public abstract BaseDrugContrast getBaseDrugContrastBySource(@DAOParam("objectDrugId") Integer objectDrugId, @DAOParam("objectId") String objectId);

    @DAOMethod(sql = " from BaseDrugContrast where objectDrugId=:objectDrugId and deleteStatus='0'")
    public abstract BaseDrugContrast getObjectDrugId(@DAOParam("objectDrugId") Integer objectDrugId);
}